<?php
include(dirname(__FILE__)."/inc/taobaoCom.php");
include(dirname(__FILE__)."/inc/template.class.php");
$templateRoot = dirname(__FILE__)."/templates/";
$tpl = new Template($templateRoot);
$iid = filter_input(INPUT_GET,'iid');
$nick = filter_input(INPUT_GET,'n');
if (!$iid)
{
	header("Location:/");
}else
{
	$class = new taobaoCom();
	$itemInfo = $class->getItemInfo($iid,$nick);
	$itemTaokeInfo = $class->getTaokeProductInfo($iid);
	if ($itemTaokeInfo[0]['click_url'])
	{
		$itemInfo[0]['detail_url'] = $itemTaokeInfo[0]['click_url'];
	}
}
$tpl->assign("itemInfo",$itemInfo[0]);
$tpl->display("item.tpl.php");